import logging,HTMLTestRunner_cn,yagmail

class Tool():
    def log(self):
        logging.basicConfig(level=logging.DEBUG,
                                  filename='./baidu.log',
                                  format='%(name)s %(message)s %(asctime)s %(thread)d',
                                  filemode='a')

    def baogao(self):
        request = HTMLTestRunner_cn.HTMLTestRunner(open('./baogao.html', 'wb'), title='测试报告')
        return request

    def qq(self):
        email = yagmail.SMTP(user='3516922232@qq.com', password='sauvhzrimccccjbi', host='smtp.qq.com')
        email.send(to='3516922232@qq.com',subject='百度',contents=['baidu.log', 'baogao.html'])


